<template>
  <div>
        <el-table :data="tableData" style="width: 100%">
          <el-table-column prop="nickname" label="反馈人"></el-table-column>
          <el-table-column prop="desc" label="反馈信息"></el-table-column>
          <el-table-column prop="create_time" label="反馈时间"></el-table-column>
                <el-table-column label="操作" width="400px">
          <template slot-scope="scope">
            <el-button @click.native.prevent="showimg(scope.row)" type="text">查看反馈图片</el-button>
          </template>
      </el-table-column>
          <!-- <el-table-column label="操作">
            <template slot-scope="scope">
              <el-button type="text" v-if="showbtnedit" @click="handleEdit(scope.row)">修改绑定</el-button>
            </template>
          </el-table-column> -->
        </el-table>
         <el-dialog title="反馈图片" :visible.sync="imgtypeDialog" width="50%">
      <!-- <el-form
        ref="imageinfo"
        :model="imageinfo"
        class="demo-form-inline"
        :rules="rules"
        label-width="100px"
      > -->
        <!-- <el-image 
        :src="srcList"
    style="width: 100px; height: 100px"
    :fit="fit"
    :preview-src-list="srcList"> -->
    <div v-if="srcList.length==0" style="height:200px">
      <div style="width:100%;text-align:center;line-height:200px">暂无图片</div>
    </div>
    <div v-else>
    <el-image v-for="item in srcList" style="width: 100px; height: 100px;margin-right:20px;margin-bottom:10px" :preview-src-list="srcList" :key="item" :src="item"></el-image>

    </div>
      <!-- </el-form> -->
    </el-dialog>
        <div style="width:100%;text-align:center;margin:50px auto;">
      <el-pagination
        background
        :page-sizes="[10, 20, 50, 100]"
        :page-size="10"
        layout="total,prev, sizes, pager, next, jumper"
        :total="totle"
        @size-change="handleSizeChange"
        @current-change="fenyeBtn"
      ></el-pagination>
    </div>
    <!-- <el-dialog title="修改绑定" :visible.sync="editpopup" width="50%" @close="closeDialog()">
      <el-form
        ref="formInfo"
        :model="formInfo"
        class="demo-form-inline"
        :rules="rules"
        label-width="100px"
      >
        <el-form-item label="门店" prop="store_name">
          <span>{{formInfo.store_name}}</span>
        </el-form-item>
        <el-form-item label="系统门店">
          <el-select v-model="value" placeholder="请选择">
            <el-option
              v-for="item in options"
              :key="item.id"
              :label="item.store_name"
              :value="item.id"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item style="text-align: right;">
          <el-button @click="editpopup=false">取消</el-button>
          <el-button type="primary" @click="submitForm('formInfo')">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog> -->
  </div>
</template>
<script>
import { lists,messopinion } from "@/api/user";
import Base64 from "@/utils/base";
import { getp_id } from "@/utils/getmenuid";
export default {
  data() {
    return {
      value:"",
      srcList:[],
      activeName: "",
      tableData: "",
      tableDatas: "",
      editpopup: false,
      formInfo: "",
      id:"",
      imageinfo:"",
      system_30: false,
      system_31: false,
      tabs: "",
      showbtnedit: true,
      page:1,
      totle:10,
      num:5,
      imgtypeDialog:false
    };
  },
  mounted(){
    setTimeout(() => {
      this.getmessList();
    }, 500);
  },
  created() {
    this.getlists();

  },
//   computed: {
//     activeItemList() {
//       return this.tabs.filter(item => {
//         return item.id != 136;
//       });
//     }
//   },
  methods: {
    showimg(val){
      this.imgtypeDialog=true
      this.srcList = val.img
    },
    handleSizeChange(val) {
      this.num = val
      this.getmessList(this.page,this.num);
    },
        // 关闭弹框
    closeDialog() {
      // this.editpopup = false;
    },
    fenyeBtn(e) {
      this.page = e;
      this.getmessList(this.page,this.num);
    },
    getmessList(page,num) {
      let parmes = {
        page: page||this.page,
        limit: num||this.num
      }
      messopinion({
        request_data: Base64.encode(JSON.stringify(parmes))
      }).then(res => {
         if(res.status==2){
          this.$message({
            message:res.message,
            type:'warning'
          })
          return
        }
        this.tableData = res.result.data
        this.totle = res.result.count
      })
    },
    // getlists() {
    //   lists({
    //     request_data: Base64.encode(JSON.stringify({ pid: getp_id() }))
    //   }).then(res => {
         
    //   });
    // }
  }
};
</script>
<style>

</style>
